1. Field of the Invention
This invention relates to a microcomputer and more particularly to a microcomputer with a single semiconductor chip on which a program memory, a program execution unit and a program mode setting circuit are provided.
2. Description of the Prior Art
In a microcomputer, generally, a program mode setting circuit is employed and which generates a start address of a program to be executed by a program execution unit (e.g. a central processing unit: CPU). The start address is set to a program counter which in turn designates the program to be read out of a program memory (for example, a read only memory: ROM) storing a plurality of instructions. The program mode setting circuit receives a mode designation signal which is applied through an external terminal of a microcomputer to the program mode setting circuit from the outside of the microcomputer. In response to the mode designation signal, the start address is read out of the program mode setting circuit and is applied to the program counter. According to a content of the program counter, an instruction located at the start address of the desired program is read out of the program memory. If the desired program contains a plurality of instructions, the remaining instructions are sequentially read out of the program memory in response to an increment operation of the program counter and are executed by the execution unit. Thus, the microcomputer automatically executes the desired program in response to the program mode designation signal applied thereto from the outside.
An example of the program mode setting circuit is an initialization circuit which initializes the program execution unit in response to a reset signal applied through a reset terminal to the initialization circuit. When the reset signal is applied, the content of the program counter is set to be, usually, zero and the start program having the zero start address is executed. In a conventional microcomputer, however, only one start address can be set in the program counter.
In the prior art, the microcomputer requires a plurality of program mode designation signals, when a plurality of desired programs are selectively designated, and a plurality of external terminals receiving them must be provided on a microcomputer chip. This makes a chip size larger and a production cost higher.